
#ifndef DESKTOPDIALOG_H
#define DESKTOPDIALOG_H

#include <BButton>
#include <BLineEdit>
#include <BComboBox>
#include <BFloatSpinBox>
#include <BRealSpinBox>
#include <BColorDialog>
#include <BSlider>
#include <BLongSlider>
#include <BFloatSlider>
#include <BDoubleSlider>
#include <BButtonGroup>
#include <BDialog>

using namespace BWE;

class DesktopDialog : public BDialog
{
	BOBJECT(DesktopDialog)
public:
	DesktopDialog(BWidget* parent = 0);
	~DesktopDialog();

	BPerch getPerch();

protected:
	void slotAssetChanged();

	void slotTopSpinBoxValueChanged(BObject* object, const BValue& value);
	void slotTopSpinBoxEditFinished(BObject* object, const BValue& value);
	void slotTopSliding(BObject* object, const BValue& value);

	void slotLeftSpinBoxValueChanged(BObject* object, const BValue& value);
	void slotLeftSpinBoxEditFinished(BObject* object, const BValue& value);
	void slotLeftSliding(BObject* object, const BValue& value);

	void slotRightSpinBoxValueChanged(BObject* object, const BValue& value);
	void slotRightSpinBoxEditFinished(BObject* object, const BValue& value);
	void slotRightSliding(BObject* object, const BValue& value);

	void slotBottomSpinBoxValueChanged(BObject* object, const BValue& value);
	void slotBottomSpinBoxEditFinished(BObject* object, const BValue& value);
	void slotBottomSliding(BObject* object, const BValue& value);

	void slotColorDialogColorChanged(BObject* object, const BValue& value);
	void slotColorTextEditFinished(BObject* object, const BValue& value);

	void slotColorButtonClicked(BObject* object, const BValue& value);
	void slotColorComboItemClicked(BObject* object, const BValue& value);
	void slotStretchEditFinished(BObject* object, const BValue& value);
	void slotAlignGroupToggled(BButtonGroup* buttonGroup, const BValue& value);

	void slotOkButtonClicked();
	void slotCancelButtonClicked();

protected:
	virtual void styleEvent(const BEvent& event);

private:
	BRealSpinBox*	_topSpinBox;
	BSlider*		_topSlider;

	BRealSpinBox*	_leftSpinBox;
	BLongSlider*	_leftSlider;

	BButton*		_colorButton;

	BRealSpinBox*	_rightSpinBox;
	BFloatSlider*	_rightSlider;

	BRealSpinBox*	_bottomSpinBox;
	BDoubleSlider*	_bottomSlider;

	BColorDialog*	_colorDialog;
	BComboBox*		_colorComboBox;
	BButton*		_textModeButton;
	BLineEdit*		_colorTextEdit;

	BHolder<BButtonGroup> _buttonGroup;

	BFloatSpinBox*	_widthStretchSpinBox;
	BFloatSpinBox*	_heightStretchSpinBox;

	BButton*		_okButton;
	BButton*		_cancelButton;
};

#endif
